sudo: false
language: node_js
node_js:
  - 4
  - 6
  - 8
  - 9
  - 10

env:
  global:
  - SAUCE_USERNAME: karmarunnerbot
  - secure: "bRVY+hYZwMf1SqVnMyZRJTLD0gN1hLx9/MwO8MM/qBiu3YNjXy49XElfMdzMKN6cZeKTmhcnjmZonbJuI1PQ2t+utGkyjnlVLJ/OlWptreKLzIlcbt4hrdPoTcjmUTwDWq9Ex9cVoYX8AzCasETttpczp3P+s3+vmOUj8z25JyU="
  - CXX=g++-4.8
matrix:
  fast_finish: true
  include:
    - node_js: "8"
      env: VALIDATE_COMMIT_MSG=true LINT=true

before_install:
  - npm config set loglevel warn
  - g++-4.8 --version
  - if [[ "`node --version`" = v4* ]]; then npm install -g npm@latest-3; fi

addons:
  firefox:
    "latest"
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.8

before_script:
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - npm run init
  - export $(openssl aes-256-cbc -pass env:CREDENTIALS_PASS -d -in credentials)
  - 'if [ "$VALIDATE_COMMIT_MSG" == "true" ]; then ./scripts/validate-commit-msg.sh $TRAVIS_COMMIT; fi'
  - 'if [ "$LINT" == "true" ]; then npm run lint; fi'

script:
  - npm run travis
